package com.scy.java.object.abstractTest.firm;

import java.util.Scanner;

//工资系统
public class PayrollSystem {
    public static void main(String[] args) {
        Employee[] emps = new Employee[2];
        emps[0] = new SalariedEmployee("强哥",1001,
                new MyDate(2023,1,1),18000);
        emps[1] = new HourlyEmployee("泰叔",1000,
                new MyDate(2022,12,31),240,100);
        System.out.println("请输入月份：");
        int month = new Scanner(System.in).nextInt();
        for (int i = 0; i < emps.length; i++) {
            System.out.println(emps[i].toString());
            System.out.println("工资为："+emps[i].earning());
            if (month == emps[i].getBirthday().getMonth()){
                System.out.println("生日快乐，加薪100");
            }
        }

    }
}
